<template>
	<view class="classLayout pageBg">
		<custom-nav-bar title="分类"></custom-nav-bar>
		<view class="classify">
			<theme-item v-for="item in ClassifyList" :key="item._id" :item="item"></theme-item>
		</view>
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue'

	import {
		apiClassify
	} from "@/api/apis.js";

	import {
		onShareAppMessage,
		onShareTimeline
	} from '@dcloudio/uni-app'

	const ClassifyList = ref([])
	//获取分类
	const getClassifyList = async () => {
		uni.showLoading({
			title: "加载中"
		})
		const res = await apiClassify({
			pageSize: 15
		})
		console.log(res, "分类")

		ClassifyList.value = res.data.filter((item, index) => index !== 1 && index !== 4 && index !== 9 &&
			index !== 13);
		uni.hideLoading();
	}
	getClassifyList()


	//分享好友
	onShareAppMessage((e) => {
		console.log(e)
		return {
			title: "Y壁纸分类",
			path: "/pages/classify/classify"
		}
	})

	//分享朋友圈
	onShareTimeline(() => {
		return {
			title: "Y壁纸",

		}
	})
</script>

<style lang="scss" scoped>
	.classify {
		padding: 30rpx;
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		gap: 15rpx;
	}
</style>